<#include "/common/layout.html">
    <@header>
</@header>
<@body>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            <small>玩家管理 > 玩家列表</small>
        </h1>
    </section>
    <!-- Main content -->
    <section class="content">
        <!-- Your Page Content Here -->
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <form action="/player/list/1" method="post" class="form-inline">
                        <div class="box-header">
                            <div class="input-group">
                                <input type="text" name="search" value="${search!}" class="form-control" placeholder="搜索玩家ID/玩家名">
                                <div class="input-group-btn">
                                    <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                                    <a href="/player/list/1" class="btn btn-default"><i class="fa fa-refresh"></i></a>
                                </div>
                            </div>
                            <div class="input-group">
                                <a class="btn btn-reddit" data-tiggle="ajax"
                                   data-submit-url="/player/frozenAll"
                                   data-confirm="是否确定冻结所有玩家？"><i class="fa fa-plus"></i> 一键冻结所有</a>
                            </div>
                        </div><!-- /.box-header -->
                    </form>
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tr>
                                <th><input name="userState" type="checkbox" class="minimal checkbox-toolbar"></th>
                                <th width="100px">玩家ID</th>
                                <th>玩家名</th>
                                <th>注册时间</th>
                                <th>账户余额</th>
                                <th>邀请人</th>
                                <th>账户状态</th>
                                <th>玩家类型</th>
                                <th>操作</th>
                            </tr>
                            <#list pageData.getRecords() as item>
                                <tr>
                                    <td>
                                        <label>
                                            <input type="checkbox" class="minimal checkbox-item">
                                        </label>
                                    </td>
                                    <td>${(item.playerId)!}</td>
                                    <td>${(item.playerName)!}</td>
                                    <td>${(item.registerTime)!}</td>
                                    <td>${(item.balance)!}</td>
                                    <td><small>${(item.fromPlayerName)!'--'}【${(item.fromPlayerId)!}】</small></td>
                                    <td>${(item.status)!}</td>
                                    <td>${(item.system)!}</td>
                                    <td>
                                        <a class="dialog" href="javascript:;" data-url="/player/betRecord/${(item.playerId)!}/1" data-title="下注记录" data-width="1280" data-height="640">下注</a> |
                                        <a class="dialog" href="javascript:;" data-url="/player/withdrawRecord/${(item.playerId)!}/1" data-title="提现记录" data-width="1280" data-height="640">提现</a> |
                                        <a class="dialog" href="javascript:;" data-url="/player/rechargeRecord/${(item.playerId)!}/1" data-title="充值记录" data-width="800" data-height="640">充值</a> |
                                        <a class="dialog" href="javascript:;" data-url="/player/inAndOut/${(item.playerId)!}" data-title="盈亏统计" data-width="600" data-height="320">盈亏</a> |
                                        <#if item.status == '正常'>
                                            <a class="btn btn-default btn-xs" data-tiggle="ajax"
                                               data-submit-url="/player/frozen?id=${(item.playerId)!}"
                                               data-confirm="您确定要冻结该玩家吗?">冻结</a> |
                                        <#else>
                                            <a class="btn btn-danger btn-xs" data-tiggle="ajax"
                                               data-submit-url="/player/unfrozen?id=${(item.playerId)!}"
                                               data-confirm="您确定要解冻该玩家吗?">解冻</a> |
                                        </#if>
                                        <a class="dialog" href="javascript:;" data-url="/player/invitePlayers/${(item.playerId)!}/1" data-title="邀请的用户" data-width="800" data-height="640">邀请的用户</a> |
                                        <#if item.system == '系统'>
                                            <a class="btn btn-default btn-xs" data-tiggle="ajax"
                                               data-submit-url="/player/setToNormal?id=${(item.playerId)!}"
                                               data-confirm="您确定要设置为普通玩家吗?">设为普通玩家</a>
                                            <#else>
                                                <a class="btn btn-primary btn-xs" data-tiggle="ajax"
                                                   data-submit-url="/player/setToSystem?id=${(item.playerId)!}"
                                                   data-confirm="您确定要设置为系统玩家吗?">设为系统玩家</a>
                                        </#if>
                                    </td>
                                </tr>
                            </#list>
                        </table>
                    </div><!-- /.box-body -->
                    <div class="box-footer row">
                        <div class="col-md-6">
                            <#include "/common/paginateBar.html" />
                            <@paginate pageData=pageData actionUrl="/player/list/" />
                        </div>
                        <div class="col-md-6 pull-left">
                            <#include "/common/paginate.html" />
                            <@paginate currentPage=pageData.getCurrent() totalPage=pageData.getPages()
                            actionUrl="/player/list/" urlParas="?pageSize=${pageSize!}" />
                        </div>
                    </div>
                </div><!-- /.box -->
            </div>
        </div>
    </section><!-- /.content -->
</div><!-- /.content-wrapper -->
</@body>
<@footer>
</@footer>